package org.grow.leavejpa.entity;

import lombok.Data;
import org.springframework.security.access.ConfigAttribute;
import org.springframework.security.core.GrantedAuthority;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;

/**
 * @Author: xwg
 * @CreateDate: 21-6-16
 */
@Entity
@Data
public class RoleInfo implements GrantedAuthority ,ConfigAttribute {
//    roleId, description, roleName, roleText
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer roleId;
    private String roleName;
    private String roleText;
    private String description;

    @Override
    public String getAuthority() {
        return roleName;
    }

    @Override
    public String getAttribute() {
        return roleName;
    }

//    @Override
//    public String getAttribute() {
//        return roleName;
//    }
}
